#!/usr/bin/python
#coding:       utf-8
#File Name:    format.py
#Version:      python 3.6
#Author:       moshan
#Mail:         mo_shan@yeah.net
#Created Time: 2018-12-06 11:04:50
#########################################################################
import codecs,sys,os
try:
    s_file_name=sys.argv[1]
    d_file_name=sys.argv[2]
except:
    print ("\n\033[1;31mpython %s s_file_name d_file_name\033[0m\n"%sys.argv[0])
    sys.exit(0)
finally:
    if len(sys.argv) > 3:
        print ("\n\033[1;31mpython %s s_file_name d_file_name\033[0m\n"%sys.argv[0])
        sys.exit(0)

if os.path.exists(s_file_name):
    if __name__ == '__main__':
        fw = open(d_file_name, 'w', encoding = 'utf_8_sig')
        with open(s_file_name, 'r') as f:
            for line in f:
                fw.write(line)
        fw.close()
else:
    print ("\n\033[1;31m%s: No such file.\033[0m\n"%s_file_name)
